package com.tjise.eduservice.config;

import com.baomidou.mybatisplus.core.injector.ISqlInjector;
import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName EduConfig
 * @Description TODO
 * @Author tjise
 * @Date 2021/6/21 20:04
 * @Version 1.0
 */
@Configuration
@MapperScan("com.tjise.eduservice.mapper")
public class EduConfig {

    /**
     * 配置 逻辑删除插件
     */

    @Bean
    public ISqlInjector sqlInjector(){
        // 返回一个逻辑删除的类
        return new LogicSqlInjector();
    }
    /**
     * mybatisplus的分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor(){
        return new PaginationInterceptor();
    }



}
